
//
// 120314 - AH - (Aura) Created.
//

package org.soekrat.engine.io;

import java.io.CharArrayWriter;
import java.io.PrintWriter;

import org.soekrat.engine.orb.Soekrat2Orb;

/**
 * <p>
 *   TODO
 * </p>
 * @author Arne Halvorsen (AH)
 * @author Laetitia Le Chatton (LLC)
 */
public final class ConversationElementXml  
{
  // Utility pattern dictates private constructor.
  private ConversationElementXml(){}
  
  public static String toXml(Soekrat2Orb orb)
  {
    if (orb==null)
    {
      throw new NullPointerException("orb");
    }
    
    AttributeObjectXml aoxml=new AttributeObjectXml();
    
    CharArrayWriter caw=new CharArrayWriter();
    PrintWriter pw=new PrintWriter(caw);
  
    pw.println("<?xml version='1.0' encoding='ISO-8859-1'?>");
    
    pw.println("<conversation-element>");
    
    aoxml.toXml(orb.getRealOrb(), pw);
    
    pw.println("</conversation-element>");
    
    pw.flush();
    return pw.toString();
  }
  
}
